package structure

import (
	"fmt"
	"reflect"
)

func GetType() {
	var v1 = 123
	fmt.Printf("v1的值%T,值是%d\n", v1, v1)

	var v2 int = 123
	fmt.Printf("v2的类型是%T\n", v2)

	var v3 = 123.0
	fmt.Printf("v3的类型是%T,值是%f\n", v3, v3)

	var v4 float32 = 123.0
	fmt.Printf("v4的类型是%T\n", v4)

	var v5 = "你妹"
	fmt.Printf("v5的类型是%T，值是%s\n", v5, v5)

	var v6 = '俏'
	fmt.Printf("v6的类型是%T\n", v6)
	fmt.Printf("v6的值是%v\n", v6)
	fmt.Printf("v6的字符是%c\n", v6)
	fmt.Printf("20431的字符是%c\n", 20431)

	arr := [5]int{1000, 2, 3, 17, 50}
	fmt.Printf("arr的类型是%T\n", arr)
	fmt.Printf("TypeOf arr的类型是%s\n", reflect.TypeOf(arr))
	fmt.Printf("arr的值是%v\n", arr)
	fmt.Println("arr的值是", arr)
}
